package com.vogue.supplymall.shop.domain.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.vogue.ssm.database.dao.BaseDao;
import com.vogue.supplymall.shop.domain.dao.ProductAttrplanDetailDao;
import com.vogue.supplymall.shop.domain.model.ProductAttrplanDetail;
import com.vogue.supplymall.shop.domain.service.ProductAttrplanDetailService;
/**
 * The type  service.
 *
 * @aouthor: gzl
 * @create: 2017 -12-01
 */
@Service("productAttrplanDetailService")
public class ProductAttrplanDetailServiceImp extends BaseServiceImpl<ProductAttrplanDetail, Long> implements ProductAttrplanDetailService {

	@Resource
	private ProductAttrplanDetailDao productAttrplanDetailDao;

	public ProductAttrplanDetailServiceImp(BaseDao<ProductAttrplanDetail, Long> baseDao) {
		super(baseDao);
		// TODO Auto-generated constructor stub
	}

	@Override
	public Long findAttrplanIdByAttrvalueId(Long attrvalueId) {
		Long attrplanId = 0L;
		List<Long> list = productAttrplanDetailDao.findAttrplanIdByAttrvalueId(attrvalueId);

		if (list.size() > 0 && list.get(0) != null) {
			attrplanId = list.get(0);
		}

		return attrplanId;
	}
}

